const app = getApp()
var queryUrl = app.globalData.queryUrl;
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentData: 0, 
  },
  //获取当前滑块的index
  bindchange: function (e) {
    let that = this;
    that.setData({
      currentData: e.detail.current
    })
  },
  /**
  * 生命周期函数--监听页面加载
  */
  onLoad: function (options) {
    var that = this
    var shopId = options.shopId
    wx.request({
      url: queryUrl + 'selectProduct',
      data: {
        shopId: "1",
      },
      method: 'post',
      success: function (res) {
        console.log(res)
      }
    })

  },
  //点击切换，滑块index赋值
  checkCurrent: function (e) {
    let that = this;

    if (that.data.currentData === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentData: e.target.dataset.current
      })
    }
  },
 
})